package idiot;

import java.util.Random;

public class CardDeck {
	
	static Card[] cards = new Card[52];
	
	
	public static void build()
	{
		String[] s = {"S", "H", "D", "C"};
		
		for (int k = 0; k < 4; k++) {
			for (int i = 1; i < 14; i++) {
				CardDeck.cards[(k * 13 + i) - 1] = new Card(s[k], i);
			}
		}
	}
	
	
	public static Card getCard(int pos) 
	{
		return cards[pos];
	}
	
	
	public static void swap(int a, int b)
	{
		Card c = CardDeck.cards[a];
		CardDeck.cards[a] = CardDeck.cards[b];
		CardDeck.cards[b] = c;
	}
	
	
	public static void shuffle()
	{
		Random r = new Random();
		
		for (int i = 0; i < 1000; i++) {
			CardDeck.swap(r.nextInt(52), r.nextInt(52));
		}
		
	}

}
